/*
 * test_claplan_frame.cpp
 *
 *  Created on: 31 Oct 2013
 *      Author: Tom Vercauteren
 */

#include "test_claplan_view.h"

#include <iostream>

using namespace std;

IMPLEMENT_APP(TestClaplanView)

TestClaplanView::TestClaplanView() :
		wxApp(), cf(0), cc(0), cd(0)
{
}

TestClaplanView::~TestClaplanView()
{
	if (cc != 0)
	{
		delete cc;
		cc = 0;
	}
	if (cd != 0)
	{
		delete cd;
		cd = 0;
	}
}

bool TestClaplanView::OnInit()
{
	if (cf == 0) cf = new ClaplanView(wxT("Claplan-editor"));
	if (cc == 0) cc = new ClaplanController();
//	if (cd == 0) cd = new ClaplanData();
//	cf->setController(cc);
	cc->setView(cf);
	cf->connectTreeEvents();
//	cc->addModel(cd);
	cc->addClaplanDataListener(cf);
	cc->setProgramName("Claplan-editor");
	cf->Show(true);
	return true;
}
